import request from '@/utils/request'

// 获取验证码
export function smsCode(bizCode, phone) {
  return request({
    url: '/scapi/smsCode?bizCode=' + bizCode + '&phone=' + phone,
    headers: {
      isToken: false
    },
    method: 'get'
  })
}

// 用户注册
export function register(data) {
  return request({
    url: '/scapi/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data
  })
}

// 忘记密码
export function forgetPwd(data) {
  return request({
    url: '/scapi/forgetPwd',
    headers: {
      isToken: false
    },
    method: 'post',
    data
  })
}

// 用户登录
export function login(data) {
  return request({
    url: '/scapi/login',
    headers: {
      isToken: false
    },
    method: 'post',
    data
  })
}

// 用户登出
export function logout(userId) {
  return request({
    url: '/scapi/logout?userId=' + userId,
    method: 'post'
  })
}

// 用户信息
export function userInfo() {
  return request({
    url: '/scapi/userInfo',
    method: 'get'
  })
}